﻿#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

//11.⾃幂数
#include <math.h>
int main()
{
	int i = 0;
	for (i = 1; i <= 100000; i++)
	{
		int n = 1;
		int tmp = i;
		int sum = 0;
		for (; tmp / 10 > 0; n++)
		{
			tmp /= 10;
		}
		tmp = i;
		while (tmp)
		{
			sum += pow(tmp % 10, n);
			tmp /= 10;
		}
		if (sum == i)
		{
			printf("%d ", i);
		}
	}
	return 0;
}


//12.打印菱形

int main()
{
	int n = 0;
	scanf("%d", &n);
	int i = 0, j = 0;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < n - 1 - i; j++)
		{
			printf(" ");
		}
		for (j = 0; j < 2 * i + 1; j++)
		{
			printf("*");
		}
		printf("\n");
	}
	for (i = 0; i < n; i++)
	{
		int j = 0;
		for (j = 0; j <= i; j++)
		{
			printf(" ");
		}
		for (j = 0; j < 2 * (n - 1 - i) - 1; j++)
		{
			printf("*");
		}
		printf("\n");
	}
	return 0;
}